//
//  GoodsModel.m
//  lokebao
//
//  Created by 陈书钦 on 15/6/27.
//  Copyright (c) 2015年 sky. All rights reserved.
//

#import "XYModel.h"

@implementation XYModel

+ (instancetype)model {
    XYModel * model = [[self alloc] init];
    return model;
}

+ (instancetype)modelWithDictionary:(NSDictionary *)dictionary {
    XYModel * model = [self model];
    [model setupWithDictionary:dictionary];
    return model;
}

- (void)setupWithDictionary:(NSDictionary *)dictionary {
    
}

- (void)modelShouldUpdate {
    if (self.delegate && [self.delegate respondsToSelector:@selector(modelShouldUpdate:)]) {
        [self.delegate modelShouldUpdate:self];
    }
}

- (void)modelDidUpdate {
    if (self.delegate && [self.delegate respondsToSelector:@selector(modelDidUpdate:)]) {
        [self.delegate modelDidUpdate:self];
    }
}

- (NSDictionary *)dictionary {
    return nil;
}

@end
